<template>
  <ELeFull ref="vELeFull">
    <IndexView />
  </ELeFull>
</template>

<script>
import IndexView from './view/v/indexView'
import ajaxApi from '@/modules/ajax-api'
import dataApi from './view/v/data-api'
import ELeFull from './view/ELeFull'
export default {
  components: {
    IndexView,
    ELeFull
  },
  beforeRouteUpdate (to, from, next) {
    if (to.query.reload) {
      this.loadData()
    }
    next()
  },
  created () {
    this.loadData()
  },
  destroyed () {
    window.jselectronic && window.jselectronic.videoControlClose()
  },
  // created () {
  //   dataApi.core = JSON.parse(ajaxApi.templateUrl)
  //   delete ajaxApi.templateUrl
  //   // ajaxApi.getDataTemp3(this.$route.query.templateurl).then(d => {
  //   //   dataApi.core = JSON.parse(ajaxApi.templateUrl)
  //   // })
  // },
  methods: {
    loadData () {
      if (ajaxApi.templateUrl) {
        dataApi.core = JSON.parse(ajaxApi.templateUrl)
        delete ajaxApi.templateUrl
        let vELeFull = this.$refs.vELeFull
        if (vELeFull) vELeFull.positionSizeUpdate()
      }
    }
  }
}
</script>
